quiche: quic client codec and setup integration test#8496
quiche: quic client codec and setup integration test#8496mattklein123 merged 89 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Dan Zhang <danzh@google.com>
481426d to
edfbf4b
Compare
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
This reverts commit 3e39fbe. Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
This reverts commit 95eb51d. Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
|
Going to put this one in waiting until we sort out the HTTP/3 PR. This is amazing though. :) /wait |
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
|
Ping? |
Signed-off-by: Dan Zhang <danzh@google.com>
mattklein123
left a comment
There was a problem hiding this comment.
Epic! Some small/random comments otherwise LGTM as something we can ship and iterate. @alyssawilk can you take another pass so we can get this merged and unblock @danzh2010? We have been very slow on reviews!
/wait
source/extensions/quic_listeners/quiche/envoy_quic_client_stream.cc
Outdated
Show resolved
Hide resolved
source/extensions/quic_listeners/quiche/envoy_quic_connection.cc
Outdated
Show resolved
Hide resolved
|
|
||
| EnvoyQuicServerSession::~EnvoyQuicServerSession() { | ||
| ASSERT(!quic_connection_->connected()); | ||
| QuicFilterManagerConnectionImpl::quic_connection_ = nullptr; |
There was a problem hiding this comment.
nit: del (similar elsewhere)
There was a problem hiding this comment.
This is needed as explained in client session.
| name: route_config_0 | ||
| )EOF"; | ||
|
|
||
| const std::string ConfigHelper::QUIC_HTTP_PROXY_CONFIG = BASE_UDP_LISTENER_CONFIG + R"EOF( |
There was a problem hiding this comment.
I wonder if this should be a config helper vs. a full new config? I will defer to @alyssawilk on this one.
There was a problem hiding this comment.
I'd mildly prefer this to be a standard config modifier / helper, especially as eventually I'd like to run the H1/H2 tests with H1/H2/H3. Eventually I think we'll want to just apply the quic config modifiers when the client / upstream type is H3 and I think that'll be easier if we use standard config, so we don't get out of sync if someone tweaks the standard access loggers or some such.
There was a problem hiding this comment.
Okay, added a TODO to generalize an HttpProxyConfig for both TCP and QUIC
alyssawilk
left a comment
There was a problem hiding this comment.
Yeah, I'm pretty much fine with this - I'm fine with any or all of my comments landing in a follow up just so we can get the big one merged.
| if (connectionSocket()->ioHandle().isOpen()) { | ||
| file_event_ = dispatcher_.createFileEvent( | ||
| connectionSocket()->ioHandle().fd(), | ||
| [this](uint32_t events) -> void { onFileEvent(events); }, Event::FileTriggerType::Edge, |
There was a problem hiding this comment.
Hand-waving here, we could have a periodic alarm which checked some runtime value (or check on packet ingress) which just disabled the listening socket. Again out of scope for this PR but I think it'd be good to be able to push via runtime and not just via LDS
source/extensions/quic_listeners/quiche/envoy_quic_client_connection.cc
Outdated
Show resolved
Hide resolved
source/extensions/quic_listeners/quiche/envoy_quic_client_session.h
Outdated
Show resolved
Hide resolved
source/extensions/quic_listeners/quiche/envoy_quic_client_session.h
Outdated
Show resolved
Hide resolved
| // callback to do it in next loop. This is because unblocking QUIC | ||
| // stream can lead to immediate upstream encoding. | ||
| unblock_posted_ = true; | ||
| connection()->dispatcher().post([this] { |
There was a problem hiding this comment.
Just checking, if something else happens in this event loop to change should_block, switchStreamBlockState will still be called. Do we handle that correctly?
There was a problem hiding this comment.
Yes, should_block_ will be updated in that case for switchStreamBlockState() to behave according to the latest value.
| name: route_config_0 | ||
| )EOF"; | ||
|
|
||
| const std::string ConfigHelper::QUIC_HTTP_PROXY_CONFIG = BASE_UDP_LISTENER_CONFIG + R"EOF( |
There was a problem hiding this comment.
I'd mildly prefer this to be a standard config modifier / helper, especially as eventually I'd like to run the H1/H2 tests with H1/H2/H3. Eventually I think we'll want to just apply the quic config modifiers when the client / upstream type is H3 and I think that'll be easier if we use standard config, so we don't get out of sync if someone tweaks the standard access loggers or some such.
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
alyssawilk
left a comment
There was a problem hiding this comment.
Again would like to see the integration test changes, but I'm happy with that being a follow-up
mattklein123
left a comment
There was a problem hiding this comment.
One small comment and then let's ship!
/wait
| public: | ||
| const std::string Client = "client_codec"; | ||
| const std::string Server = "server_codec"; | ||
| const std::string Client = "quiche_client"; |
There was a problem hiding this comment.
We shouldn't let "quiche" leak into any core code. This should only be inside the extension itself, right? Can you move this into the extension directory or just remove this file entirely unless it needs to be referenced elsewhere?
There was a problem hiding this comment.
I think we don't want any core code depends on extension code. That's why I add them here. These are used to create quic codec in CodecHelper and integration test, we can't remove them.
There was a problem hiding this comment.
This is in the common directory. Just move this file into the extension directory then? There shouldn't be any reference to quiche in common code.
There was a problem hiding this comment.
Current this codec name is hard coded in codec_client and codec_config. It's possible to pass down from config for different QUIC implmentations, but currently there is no need. So I added a TODO for that at the call sites.
Meanwhile the names here should indicate that we are using QUICHE implementation, but no need to differentiate client and server. So I changed them to one var "Quiche".
Signed-off-by: Dan Zhang <danzh@google.com>
| codec_ = std::unique_ptr<ClientConnection>( | ||
| Config::Utility::getAndCheckFactory<Http::QuicHttpClientConnectionFactory>( | ||
| Http::QuicCodecNames::get().Client) | ||
| Http::QuicCodecNames::get().Quiche) |
There was a problem hiding this comment.
nit: similar TODO here for config. Please add this in a follow up.
Implement EnvoyQuicClientStream|Session|Connection which are similar to server side code. EnvoyQuicClientConnection, as Network::ClientConnection, also dispatches IO events.
Use codec type HTTP3 and corresponding stats in QUIC codecs. Integrate QUIC server and client codec with HCM and ClientCodec via corresponding factory to avoid direct dependency on QUICHE code.
Risk Level: low, refactor to unused code
Testing: added quic_http_integration_test.cc and ConfigHelper::QUIC_HTTP_PROXY_CONFIG
Part of #2557